<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>isNaN和parseInt和parseFloat使用</title>
</head>

<body>
    <script>
        var num = 10
        console.log(isNaN(num)) //false
        console.log(isNaN(undefined)) //true
        console.log(isNaN(null)) //false
        console.log(isNaN(''));//false
        console.log(isNaN(0));//false 
        console.log(isNaN(true));//false
        console.log(isNaN('x10')) //true
        num = NaN

        console.log(isNaN(num)) //true
        console.log(NaN == NaN) // false

        console.log(parseInt('10')) //10
        console.log(parseInt('10x')) //10
        console.log(parseInt('x10')) //NaN

        console.log(+'10') //10
        console.log(+'10x') //NaN

        console.log(parseFloat('10.55')) //10.55
        console.log(parseFloat('10.55xyz')) //10.55
        console.log(parseFloat('xx10.55')) //NaN

        console.log(parseFloat(+'10.55xyz'))//NaN
    </script>
</body>

</html>